﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Icms.Resources;
using Omu.Awesome.Mvc;

namespace Icms.WebUI.Dto
{
    public class ReportRequestInput
    {
        public ReportRequestInput()
        {
            DateFrom = DateTime.Now.AddYears(-1);
            DateTo = DateTime.Now;
        }

        [Req]
        [UIHint("Lookup")]
        [DisplayName("Raport")]
        [Lookup(Fullscreen = true)]
        public Guid? ReportTemplateId { get; set; }

        [Req]
        [DisplayName("De la")]
        public DateTime? DateFrom { get; set; }

        [Req]
        [DisplayName("Pana la")]
        public DateTime? DateTo { get; set; }

        [UIHint("AjaxDropdown")]
        [AjaxDropdown(Controller = "CourtAjaxDropdown")]
        [DisplayName("Judecatoria")]
        public Guid? CourtId { get; set; }
    }

    public class AddParametersInput : Input
    {
        [UIHint("Lookup")]
        public IEnumerable<Guid> Parameters { get; set; }
    }

    public class SignInInput
    {
        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Login")]
        public string Login { get; set; }

        [Req]
        [UIHint("Password")]
        [Display(ResourceType = typeof(Mui), Name = "Password")]
        public string Password { get; set; }

        [Display(Name = "Retine")]
        public bool Remember { get; set; }
    }

    public class ChangePasswordInput
    {
        public Guid UserId { get; set; }

        [UIHint("Password")]
        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Password")]
        public string Password { get; set; }
    }

    public class UserCreateInput : UserInput
    {
        [Req]
        [StrLen(20)]
        public string Login { get; set; }

        [Req]
        [UIHint("Password")]
        [StrLen(50)]
        [Display(ResourceType = typeof(Mui), Name = "Password")]
        public string Password { get; set; }


    }

    public class UserInput : Input
    {
        [UIHint("Lookup")]
        [Display(Name = "Judecatoria")]
        [Lookup(Controller = "CourtLookup")]
        public Guid? CourtId { get; set; }

        [Req]
        [Display(Name = "Prenume")]
        [StrLen(20)]
        public string FirstName { get; set; }

        [Req]
        [Display(Name = "Nume")]
        [StrLen(20)]
        public string LastName { get; set; }


        [Display(Name = "Patronimic")]
        public string Surname { get; set; }

        [UIHint("lookup")]
        [Lookup(Multiselect = true)]
        [Req]
        [Display(Name = "Roluri")]
        public IEnumerable<Guid> Roles { get; set; }
    }

    public class RoomInput : Input
    {
        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Title")]
        public string Title { get; set; }

        [Display(ResourceType = typeof(Mui), Name = "Position")]
        public string Position { get; set; }
    }

    public class ParameterInput : Input
    {
        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Code")]
        public string Code { get; set; }

        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Title")]
        public string Title { get; set; }

        [Display(ResourceType = typeof(Mui), Name = "Comments")]
        public string Comments { get; set; }
        public int? Ord { get; set; }

        [UIHint("Lookup")]
        [Lookup]
        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Classifier")]
        public Guid? ClassifierId { get; set; }
    }

    public class CaseTypeInput : Input
    {
        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Title")]
        public string Title { get; set; }
        [Display(ResourceType = typeof(Mui), Name = "Code")]
        public string Code { get; set; }

        [Display(Name = "Termen (zile)")]
        public int TimeResolved { get; set; }

        [UIHint("AjaxDropdown")]
        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Category")]
        public Guid? CategoryId { get; set; }
    }

    public class TemplateInput : Input
    {
        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Title")]
        public string Title { get; set; }

        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Content")]
        [UIHint("Wy")]
        public string Content { get; set; }

        [Req]
        [Lookup(Controller = "ParameterLookup")]
        [AwesomeParameters("{code:'templatetype'}")]
        [UIHint("Lookup")]
        [Display(Name = "Tip")]
        public Guid? TypeId { get; set; }
    }

    public class TeamInput : Input
    {
        [Req]
        [Display(ResourceType = typeof(Mui), Name = "Title")]
        public string Title { get; set; }

        [Req]
        [UIHint("AjaxDropdown")]
        [AjaxDropdown(Controller = "UserAjaxDropdown", ParentId = "JudgeRoleId")]
        [Display(ResourceType = typeof(Mui), Name = "Judge")]
        public Guid? JudgeId { get; set; }

        [Req]
        [UIHint("AjaxDropdown")]
        [AjaxDropdown(Controller = "UserAjaxDropdown", ParentId = "SecretarialRoleId")]
        [Display(ResourceType = typeof(Mui), Name = "Secretarial")]
        public Guid? SecretarialId { get; set; }
    }

    public class CourtCfgInput : Input
    {
        public bool ManualAssignForAdministrativeCases { get; set; }
        public bool ManualAssignForCivilCases { get; set; }
        public bool ManualAssignForCriminalCases { get; set; }
        public bool ManualAssignForEconomicCases { get; set; }
        [Req]
        public DateTime? OldCaseMaxDate { get; set; }
        public int RandomAssignmentDeputyPersent { get; set; }
        public int RandomAssignmentPresidentPersent { get; set; }
        public bool UseCollegesInRandomAssignment { get; set; }
    }

    public class FileCreateInput : FileEditInput
    {
        public Guid? CaseId { get; set; }
        public Guid? EntityId { get; set; }

        [Req]
        [Display(Name = "Nume")]
        public string Name { get; set; }

        public string ContentType { get; set; }
    }

    public class FileEditInput : Input
    {
        [Req]
        [Display(Name = "Titlu")]
        public string Title { get; set; }

        [Display(Name = "Subiect")]
        public string Subject { get; set; }

        [Display(Name = "Data inregistrarii")]
        public DateTime? RegisteredOn { get; set; }

        [Display(Name = "Soursa")]
        public string Source { get; set; }

        [Display(Name = "Numar protocolar al sursei")]
        public string SourceProtocolNumber { get; set; }

        [UIHint("AjaxDropdown")]
        [Display(Name = "Limba")]
        public Guid? LanguageId { get; set; }

        [Display(Name = "Numar intern de intrare")]
        public string InternalProtocolNumber { get; set; }

        [Display(Name = "Numar de protocol")]
        public string ProtocolNumber { get; set; }
    }

    public class HearingInput : Input
    {
        public Guid? CaseId { get; set; }

        [UIHint("AjaxDropdown")]
        [Req]
        [Display(Name = "Sala")]
        public Guid? RoomId { get; set; }

        [UIHint("AjaxDropdown")]
        [AjaxDropdown(Controller = "ParCodeIKAjaxDropdown")]
        [AwesomeParameters("{code:'hearingtype'}")]
        [Req]
        [Display(Name = "Tip")]
        public Guid? TypeId { get; set; }

        [Display(Name = "Data")]
        public DateTime? Date { get; set; }
        public int Hour { get; set; }
        public int Minute { get; set; }
        public int DurationMinutes { get; set; }
        public int DurationHours { get; set; }

        [Display(Name = "Secret")]
        public bool IsSecret { get; set; }

        [Display(Name = "Limba de stat")]
        public bool StateLanguage { get; set; }

        [Display(Name = "Admisibilitatea cererii de recurs")]
        public bool OnCasationRequestAdmisibility { get; set; }

        [UIHint("Lookup")]
        [Lookup(Multiselect = true)]
        [Req]
        [Display(Name = "Participanti")]
        public IEnumerable<Guid> Parties { get; set; }

        [UIHint("Lookup")]
        [Lookup(Multiselect = true)]
        [Display(Name = "Trimite mesaj")]
        public IEnumerable<Guid> Users { get; set; }
    }

    public class RulingInput : Input
    {
        [Req]
        public Guid? CaseId { get; set; }

        [UIHint("AjaxDropdown")]
        [AjaxDropdown(ParentId = "CaseId")]
        [Display(Name = "Sedinta")]
        public Guid? HearingId { get; set; }

        [UIHint("Lookup")]
        [Display(Name = "Model")]
        public Guid? TemplateId { get; set; }

        [UIHint("AjaxDropdown")]
        [AjaxDropdown(Controller = "ParCodeIKAjaxDropdown")]
        [AwesomeParameters("{code:'RulingType'}")]
        [Display(Name = "Tip incheiere")]
        public Guid? RulingTypeId { get; set; }

        [Req]
        [UIHint("Wy")]
        [Display(Name = "Continut")]
        public string DocBytes { get; set; }

        [Req]
        [UIHint("AjaxRadioList")]
        [Display(Name = "Statut")]
        public string Status { get; set; }
    }
}